/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package chat_sockets;

import conection.Cliente;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.UnknownHostException;

/**
 *
 * @author javi
 */
public class Main {
    
    public static String host;
    public static final int puerto=12345;
    
    public static void main(String[] args){
        try {
            System.out.print("Introduzca la ip a la que quiere conectar: ");
            host = new BufferedReader(new InputStreamReader(System.in)).readLine();
            Cliente nuevoCliente = new Cliente(host,puerto);
            Thread hiloCliente = new Thread(nuevoCliente);
            hiloCliente.start();
        } catch (UnknownHostException ex) {
            System.err.println("Servidor no encontrado.");
            //Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            System.err.println("Servidor no disponible.");
            //Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
}
